package com.iris.live.services.common.reconsitution;

import com.iris.live.services.common.StringUtils;

/**
 * yitianle
 * 构建message文本
 * 2017/02/17
 */
public class MessageContext {

    //非调车message

    /**
     * 提交一审给一级管理员message文本
     *
     * @param modelType
     * @param customer
     * @param mobile
     * @return
     */
    public static String getFristApproveForAdminContext(String modelType, String customer, String mobile) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)){
            mobile = "无";
        }
        return "新的" + modelType + "申请需要您审批,客户姓名：" + customer + "，顾客电话：" + mobile;
    }

    /**
     * 提交一审给销售顾问message文本
     *
     * @param customer
     * @param mobile
     * @return
     */
    public static String getFristApproveForSalesContext(String customer, String mobile) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)){
            mobile = "无";
        }
        return "申请审批提交成功!客户姓名：" + customer + "，客户电话：" + mobile;
    }


    //调车message

    /**
     * 调车调入发送消息给一级审批员文本
     *
     * @param customer
     * @param mobile
     * @return
     */
    public static String getShuntingInFirstApproveForAdmin(String customer, String mobile) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return "有新的调车调入审批需要您审批，客户姓名：" + customer + "，客户电话：" + mobile;
    }

    /**
     * 调车调入给销售行政发消息
     *
     * @param customer
     * @param mobile
     * @return
     */
    public static String getShuntingInForSalesAdmin(String customer, String mobile) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return "您提交的调车调入申请提交成功！，客户姓名：" + customer + "，客户电话：" + mobile;
    }

    /**
     * 调车调出发送消息给一级审批员文本
     *
     * @return
     */
    public static String getShuntingOutFirstApproveForAdmin() {
        return "有新的调车调出审批需要您审批";
    }

    /**
     * 本店或者他店最后一级审批人(调车调出)
     *
     * @param dealerName
     * @param productionNum
     * @param carInfo
     * @return
     */
    public static String getPostCarTransferInProcess(String dealerName, String productionNum, String carInfo) {
        return "调入经销商为 " + dealerName + " 管理层全部通过了的生产号为" + productionNum
                + ",车款为" + carInfo + "的调车审批，请留意调出审批列表";
    }

    /**
     * 本店或者他店最后一级审批人通过/驳回(调车调出)
     *
     * @param date
     * @param productionNum
     * @param carInfo
     * @param customer
     * @param mobile
     * @param approveStatus
     * @return
     */
    public static String getPostCarTransferInProcessForSaleAdmin(String date, String productionNum, String carInfo,
                                                                 String customer, String mobile, boolean approveStatus) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        if (approveStatus) {
            return "您于" + date + "提交的生产号为" + productionNum + ",车款为" + carInfo + "的调车调入申请已通过内部审批,顾客姓名：" +
                    customer + ",顾客电话：" + mobile;
        } else {
            return "您于" + date + "提交的生产号为" + productionNum + ",车款为" + carInfo + "的调车调入申请已被内部驳回,顾客姓名：" +
                    customer + ",顾客电话：" + mobile;
        }
    }

    /**
     * 调车完成
     *
     * @param customer
     * @param targetName
     * @param carType
     * @return
     */
    public static String getPostCarTransferSuss(String customer, String targetName, String carType) {
        return customer + "向" + targetName + "调车" + carType + "财务开票完成，请尽快付款";
    }


    //CRM

    /**
     * 给顾客分配新的sc message text
     *
     * @param customer
     * @param mobile
     * @return
     */
    public static String setNewScForCustomer(String customer, String mobile) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return "您有新分配的线索,顾客姓名：" + customer + "，顾客电话：" + mobile;
    }

    /**
     * 给顾客分配sc message text
     *
     * @param customer
     * @param mobile
     * @return
     */
    public static String setScForCustomer(String customer, String mobile) {
        return "客户" + customer + "，联系电话" + mobile + ",请尽快联系";
    }

    //后市场

    /**
     * 后市场提交精品订单
     *
     * @param permit
     * @return
     */
    public static String postAfterMarketOrder(String permit) {
        return "经销商" + permit + "提交后市场精品订单申请";
    }


    //物流

    /**
     * 获取车辆物流信息
     *
     * @param customer
     * @param mobile
     * @param postDate
     * @param carInfo
     * @param color
     * @param logisticsStatus
     * @return
     */
    public static String getCarLogistics(String customer, String mobile, String postDate,
                                         String carInfo, String color, String logisticsStatus) {
        return "您的顾客" + customer + "(" + mobile + ")于" + postDate + "申请的订单" +
                carInfo + "(" + color + ")物流状态已变更:" + logisticsStatus;
    }

    //金融

    /**
     * 报价方案
     *
     * @param customer
     * @param gender
     * @param mobile
     * @return
     */
    public static String getCommonFinancialOffer(String customer, String gender, String mobile) {
        return "客户" + customer + gender + "，电话号码" + mobile + "，新车金融报价已完成，请查看。";
    }


    //预约

    /**
     * 预约进店
     *
     * @param customer
     * @param time
     * @return
     */
    public static String getAppointment(String customer, String time) {
        return customer + " 预约" + time + "进店";
    }


    /**
     * 编辑报价单完成
     *
     * @param customer
     * @param carType
     * @return
     */
    public static String updateQuotation(String customer, String carType) {
        return "您的顾客" + customer + "购买" + carType + "已经付款完成";
    }

    //行政、财务
    /**
     *合同审批后处理财务消息
     * @return
     */
    public static String getApprovalAgreement(String carInfo,String customer,String mobile){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return  "合同审批已通过全部审批，车款为" + carInfo +
                ",顾客姓名：" + customer + ",顾客电话：" + mobile;
    }
    /**
     *意向订单审批后处理财务消息
     * @return
     */
    public static String getPurposeApprovalAgreement( String customer,String mobile){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return  "顾客姓名："+ customer +",顾客电话：" + mobile+"的意向订单已通过审批，请确认已收到意向金";
    }
    /**
     *订单审批后处理财务消息
     * @return
     */
    public static String getOrderApprovalAgreement(String customer,String mobile){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return  "顾客姓名："+ customer +",顾客电话：" + mobile+"的订单已通过审批，请确认已收到订金";
    }
    /**行政  删除车辆
     * @return
     */
    public static String getDeleteStock(String vin,String cusName ){
        return  "车架号"+vin+"，顾客"+cusName+"对应车辆资源即将被被销售行政删除，请及时调配车辆！";
    }
    /**
     * 需要车资确认发送财务专员消息通知
     * @return
     */
    public static String getCheckCarSource(String carInfo,String customer,String mobile){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return  "有车架号为" + carInfo +
                "的车辆资源需要您的确认，顾客姓名：" + customer + ",顾客电话：" + mobile;
    }

    /**
     * 需要车资确认发送财务消息通知
     * @return
     */
    public static String getCheckCarSourcePass(String headText,String carInfo,String customer,String mobile,int entrance){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)) {
            mobile = "无";
        }
        return "审批已通过全部审批，车款为" + carInfo +
                        ",顾客姓名：" + customer + ",顾客电话：" + mobile;
    }


    /**
     * 车资确认后发送销售顾问消息通知
     */
    public static String getCheckSourceSalePass(String headText,String prodNum,String customer,String mobile,int entrance){
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        if (StringUtils.isNullOrBlank(mobile)){
            mobile = "无";
        }
        String content ="";
        switch (entrance){
            case DefaultValueConstant.CHECK_CAR_SOURCE_OUT:
                content = "您提交的生产号为" + prodNum + "的车辆的"+ headText +"审批已经通过,客户姓名：" +
                        customer + ",客户电话：" + mobile + ",请等待财务出入账后再申请开票";
            case DefaultValueConstant.CHECK_CAR_SOURCE_IN:
                content = "您提交的生产号为" + prodNum + "的车辆的"+ headText +"销售行政资源确认已通过,客户姓名：" +
                        customer + ",客户电话：" + mobile + ",请等待财务出入账后再申请开票";
        }
        return content;
    }

    //DCC分配线索，通知sc认领信息
    public static String getDCCDistributionClueMessage (String customer) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        return "请及时接收并跟进DCC分配的潜客线索" + customer;
    }

    //DCC分配线索，sc未认领，退回DCC信息
    public static String getDCCDistributionClueOverTimeMessage (String customer) {
        if (StringUtils.isNullOrBlank(customer)) {
            customer = "无";
        }
        return "潜客线索：" + customer + " 由于超时未接收，已被退回DCC";
    }

}
